/*
 * TelaClienteCadastro.java
 *
 * Created on __DATE__, __TIME__
 */

package telas.aluguel;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

import business.aluguel.Cliente;
import business.aluguel.EmpresaCliente;
import business.aluguel.Endereco;
import business.aluguel.TipoCnh;
import business.sistema.ExceptionSistema;
import business.sistema.IObjetoSistema;
import business.util.Menssagens;
import business.util.ValidadaCPF;
import telas.comum.TelaDialogoCadastro;

/**
 *
 * @author  __USER__
 */
public class TelaClienteCadastro extends TelaDialogoCadastro
{
	private static final long serialVersionUID = 7418667126377253822L;

	/** Creates new form TelaClienteCadastro */
	public TelaClienteCadastro(java.awt.Frame parent, boolean modal)
			throws Exception
	{
		super(parent, modal);
		initComponents();
	}

	public TelaClienteCadastro(IObjetoSistema objetoSistema, boolean novo)
			throws Exception
	{
		super(objetoSistema, novo);
		initComponents();

		if (!novo)
		{
			setTitle("Alterar Cliente");
			preencherFormulario();
		} else
		{
			setTitle("Cadastrar Cliente");
		}

		eventoSalvar();
		eventoFechar();

		setVisible(true);
	}

	@Override
	public void preencherFormulario() throws Exception
	{
		Cliente cliente = (Cliente) getObjDados();

		ctNome.setText(cliente.getNome());
		ctIdentidade.setText(cliente.getIdentidade());
		jftCPF.setText(cliente.getCpf());
		ctCnh.setText(cliente.getCnh());

		if (cliente.getTipoCnh() != null)
		{
			cgTipoCnh.setObjetoCorrente(cliente.getTipoCnh());
		}

		jftTelefone.setText(cliente.getTelefone());
		jftCelular.setText(cliente.getCelular());
		ctContato1.setText(cliente.getContato1());
		ctTelefone1.setText(cliente.getTelefone1());
		ctContato2.setText(cliente.getContato2());
		ctTelefone2.setText(cliente.getTelefone2());

		if (cliente.getEnderecos() != null)
		{
			for (Endereco endereco : cliente.getEnderecos())
			{
				ctEndereco.setText(endereco.getEndereco());
				ctNumero.setText(endereco.getNumero());
				ctBairro.setText(endereco.getBairro());
				ctCidade.setText(endereco.getCidade());
				jftCep.setText(endereco.getCep());

				break;
			}
		}

		if (cliente.getEmpresas() != null)
		{
			for (EmpresaCliente empresa : cliente.getEmpresas())
			{
				ctNomeEmpresa.setText(empresa.getNome());
				ctFuncao.setText(empresa.getFuncao());
				ctTelefoneEmpresa1.setText(empresa.getTelefone1());
				ctTelefoneEmpresa2.setText(empresa.getTelefone2());
				ctEnderecoEmpresa.setText(empresa.getEndereco());
				ctNumeroEmpresa.setText(empresa.getNumero());
				ctBairroEmpresa.setText(empresa.getBairro());
				ctCidadeEmpresa.setText(empresa.getCidade());
				ctCepEmpresa.setText(empresa.getCep());
			}
		}
	}

	private void eventoFechar()
	{
		botBotoes.getBtFechar().addActionListener(new ActionListener()
		{
			@Override
			public void actionPerformed(ActionEvent e)
			{
				try
				{
					fecharTela();
				} catch (Exception ex)
				{
					new ExceptionSistema(ex);
				}
			}
		});
	}

	private void eventoSalvar()
	{
		botBotoes.getBtSalvar().addActionListener(new ActionListener()
		{
			@Override
			public void actionPerformed(ActionEvent e)
			{
				try
				{
					salvar();
					limpaCadastro();

				} catch (Exception ex)
				{
					new ExceptionSistema(ex);
				}
			}
		});
	}

	@Override
	public void limpaCadastro() throws Exception
	{
		ctNome.setText("");
		ctIdentidade.setText("");
		jftCPF.setText("");
		jftTelefone.setText("");
		jftCelular.setText("");
		ctContato1.setText("");
		ctTelefone1.setText("");
		ctContato2.setText("");
		ctTelefone2.setText("");

		ctEndereco.setText("");
		ctNumero.setText("");
		ctBairro.setText("");
		ctCidade.setText("");
		jftCep.setText("");

		ctNomeEmpresa.setText("");
		ctNumero.setText("");
		ctTelefoneEmpresa1.setText("");
		ctTelefoneEmpresa2.setText("");
		ctEnderecoEmpresa.setText("");
		ctNumeroEmpresa.setText("");
		ctBairroEmpresa.setText("");
		ctCidadeEmpresa.setText("");
		ctCepEmpresa.setText("");
	}

	@Override
	public void preencheObjeto() throws Exception
	{
		String mensagem = "";

		if (ctNome.getText().equals(""))
		{
			mensagem += "Nome " + Menssagens.itemObrigatorio;
		}

		if (ctIdentidade.getText().equals(""))
		{
			mensagem += "\nIdentidade " + Menssagens.itemObrigatorio;
		}

		if (jftCPF.getText().equals("   .   .   -  "))
		{
			mensagem += "\nCPF " + Menssagens.itemObrigatorio;
		}

		String cnh = ctCnh.getText();

		TipoCnh tipoCnh = (TipoCnh) cgTipoCnh.getObjetoCorrente();

		if (ctEndereco.getText().equals(""))
		{
			mensagem += "\nEndereço " + Menssagens.itemObrigatorio;
		}

		if (ctNumero.getText().equals(""))
		{
			mensagem += "\nNumero " + Menssagens.itemObrigatorio;
		}

		if (ctBairro.getText().equals(""))
		{
			mensagem += "\nBairro " + Menssagens.itemObrigatorio;
		}

		if (ctCidade.getText().equals(""))
		{
			mensagem += "\nCidade " + Menssagens.itemObrigatorio;
		}

		if (jftCep.getText().equals("  .   -   "))
		{
			mensagem += "\nCEP " + Menssagens.itemObrigatorio;
		}

		if (mensagem.equals(""))
		{
			Cliente cliente = (Cliente) getObjDados();

			cliente.setNome(ctNome.getText());
			cliente.setIdentidade(ctIdentidade.getText());
			cliente.setCpf(jftCPF.getText());
			cliente.setCnh(cnh);
			cliente.setTipoCnh(tipoCnh);
			cliente.setTelefone(jftTelefone.getText());
			cliente.setCelular(jftCelular.getText());
			cliente.setContato1(ctContato1.getText());
			cliente.setTelefone1(ctTelefone1.getText());
			cliente.setContato2(ctContato2.getText());
			cliente.setTelefone2(ctTelefone2.getText());

			Endereco endereco = null;

			if (cliente.getEnderecos() != null)
			{
				for (Endereco enderecoCadastrado : cliente.getEnderecos())
				{
					endereco = enderecoCadastrado;
					break;
				}
			}

			if (endereco == null)
			{
				endereco = new Endereco();

				cliente.addEndereco(endereco);
			}

			endereco.setEndereco(ctEndereco.getText());
			endereco.setNumero(ctNumero.getText());
			endereco.setBairro(ctBairro.getText());
			endereco.setCidade(ctCidade.getText());
			endereco.setCep(jftCep.getText());

			EmpresaCliente empresa = null;

			if (cliente.getEmpresas() != null)
			{
				for (EmpresaCliente empresaCadastrada : cliente.getEmpresas())
				{
					empresa = empresaCadastrada;
				}
			}

			if (empresa == null)
			{
				empresa = new EmpresaCliente();

				cliente.addEmpresa(empresa);
			}

			empresa.setNome(ctNomeEmpresa.getText());
			empresa.setFuncao(ctFuncao.getText());
			empresa.setTelefone1(ctTelefoneEmpresa1.getText());
			empresa.setTelefone2(ctTelefoneEmpresa2.getText());
			empresa.setEndereco(ctEnderecoEmpresa.getText());
			empresa.setNumero(ctNumeroEmpresa.getText());
			empresa.setBairro(ctBairroEmpresa.getText());
			empresa.setCidade(ctCidadeEmpresa.getText());
			empresa.setCep(ctCepEmpresa.getText());

		} else
		{
			throw new Exception(mensagem);
		}
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	//GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents()
	{

		pnlPrincipal = new telas.componentes.Painel();
		botBotoes = new telas.componentes.BarraOperacoesTela();
		jtpCadastro = new javax.swing.JTabbedPane();
		pnlCadastroCliente = new telas.componentes.Painel();
		rotulo1 = new telas.componentes.Rotulo();
		rotulo2 = new telas.componentes.Rotulo();
		rotulo3 = new telas.componentes.Rotulo();
		rotulo4 = new telas.componentes.Rotulo();
		rotulo5 = new telas.componentes.Rotulo();
		ctIdentidade = new telas.componentes.CampoTexto();
		ctNome = new telas.componentes.CampoTexto();
		jftCPF = new javax.swing.JFormattedTextField();
		jftTelefone = new javax.swing.JFormattedTextField();
		jftCelular = new javax.swing.JFormattedTextField();
		rotulo11 = new telas.componentes.Rotulo();
		ctCnh = new telas.componentes.CampoTexto();
		rotulo12 = new telas.componentes.Rotulo();
		cgTipoCnh = new telas.componentes.ComboGeral();
		rotulo22 = new telas.componentes.Rotulo();
		rotulo23 = new telas.componentes.Rotulo();
		ctContato1 = new telas.componentes.CampoTexto();
		ctContato2 = new telas.componentes.CampoTexto();
		rotulo24 = new telas.componentes.Rotulo();
		ctTelefone1 = new telas.componentes.CampoTexto();
		rotulo25 = new telas.componentes.Rotulo();
		ctTelefone2 = new telas.componentes.CampoTexto();
		pnlCadastroEndereco = new telas.componentes.Painel();
		rotulo6 = new telas.componentes.Rotulo();
		rotulo7 = new telas.componentes.Rotulo();
		rotulo8 = new telas.componentes.Rotulo();
		rotulo9 = new telas.componentes.Rotulo();
		rotulo10 = new telas.componentes.Rotulo();
		ctEndereco = new telas.componentes.CampoTexto();
		ctNumero = new telas.componentes.CampoTexto();
		ctBairro = new telas.componentes.CampoTexto();
		ctCidade = new telas.componentes.CampoTexto();
		jftCep = new javax.swing.JFormattedTextField();
		painel1 = new telas.componentes.Painel();
		rotulo13 = new telas.componentes.Rotulo();
		rotulo14 = new telas.componentes.Rotulo();
		rotulo15 = new telas.componentes.Rotulo();
		rotulo16 = new telas.componentes.Rotulo();
		rotulo17 = new telas.componentes.Rotulo();
		rotulo18 = new telas.componentes.Rotulo();
		rotulo19 = new telas.componentes.Rotulo();
		ctNomeEmpresa = new telas.componentes.CampoTexto();
		ctFuncao = new telas.componentes.CampoTexto();
		ctTelefoneEmpresa1 = new telas.componentes.CampoTexto();
		ctTelefoneEmpresa2 = new telas.componentes.CampoTexto();
		ctEnderecoEmpresa = new telas.componentes.CampoTexto();
		ctNumeroEmpresa = new telas.componentes.CampoTexto();
		rotulo20 = new telas.componentes.Rotulo();
		ctBairroEmpresa = new telas.componentes.CampoTexto();
		ctCidadeEmpresa = new telas.componentes.CampoTexto();
		rotulo21 = new telas.componentes.Rotulo();
		ctCepEmpresa = new telas.componentes.CampoTexto();

		setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

		pnlPrincipal.setLayout(new java.awt.BorderLayout());
		pnlPrincipal.add(botBotoes, java.awt.BorderLayout.PAGE_END);

		jtpCadastro.setBorder(javax.swing.BorderFactory
				.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));

		rotulo1.setText("Nome:");

		rotulo2.setText("Identidade:");

		rotulo3.setText("CPF:");

		rotulo4.setText("Telefone:");

		rotulo5.setText("Celular:");

		ctIdentidade.setMaxLength(15);

		ctNome.setMaxLength(100);

		try
		{
			jftCPF
					.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(
							new javax.swing.text.MaskFormatter("###.###.###-##")));
		} catch (java.text.ParseException ex)
		{
			ex.printStackTrace();
		}
		jftCPF.addFocusListener(new java.awt.event.FocusAdapter()
		{
			public void focusLost(java.awt.event.FocusEvent evt)
			{
				jftCPFFocusLost(evt);
			}
		});

		try
		{
			jftTelefone
					.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(
							new javax.swing.text.MaskFormatter("(##)####-####")));
		} catch (java.text.ParseException ex)
		{
			ex.printStackTrace();
		}

		try
		{
			jftCelular
					.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(
							new javax.swing.text.MaskFormatter("(##)####-####")));
		} catch (java.text.ParseException ex)
		{
			ex.printStackTrace();
		}

		rotulo11.setText("CNH:");

		ctCnh.setMaxLength(20);

		rotulo12.setText("Tipo");

		cgTipoCnh.setModel(new javax.swing.DefaultComboBoxModel(new String[]
		{ "Selecione" }));
		cgTipoCnh.setMetodoDescricao("getNome");
		cgTipoCnh.setMetodoIdentificador("getCodigo");
		cgTipoCnh.setDataSource(tipoCnh.obterTodos());

		rotulo22.setText("Contato1:");

		rotulo23.setText("Contato2:");

		ctContato1.setMaxLength(100);

		ctContato2.setMaxLength(100);

		rotulo24.setText("Telefone:");

		try
		{
			ctTelefone1
					.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(
							new javax.swing.text.MaskFormatter("(##)####-####")));
		} catch (java.text.ParseException ex)
		{
			ex.printStackTrace();
		}

		rotulo25.setText("Telefone:");

		try
		{
			ctTelefone2
					.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(
							new javax.swing.text.MaskFormatter("(##)####-####")));
		} catch (java.text.ParseException ex)
		{
			ex.printStackTrace();
		}

		javax.swing.GroupLayout pnlCadastroClienteLayout = new javax.swing.GroupLayout(
				pnlCadastroCliente);
		pnlCadastroCliente.setLayout(pnlCadastroClienteLayout);
		pnlCadastroClienteLayout
				.setHorizontalGroup(pnlCadastroClienteLayout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								pnlCadastroClienteLayout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												pnlCadastroClienteLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addGroup(
																pnlCadastroClienteLayout
																		.createSequentialGroup()
																		.addGroup(
																				pnlCadastroClienteLayout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.LEADING)
																						.addComponent(
																								rotulo2,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								rotulo1,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								rotulo3,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								rotulo5,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								rotulo11,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								rotulo4,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				pnlCadastroClienteLayout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.LEADING)
																						.addComponent(
																								ctNome,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								643,
																								Short.MAX_VALUE)
																						.addGroup(
																								pnlCadastroClienteLayout
																										.createSequentialGroup()
																										.addGroup(
																												pnlCadastroClienteLayout
																														.createParallelGroup(
																																javax.swing.GroupLayout.Alignment.TRAILING,
																																false)
																														.addComponent(
																																ctCnh,
																																javax.swing.GroupLayout.Alignment.LEADING,
																																javax.swing.GroupLayout.DEFAULT_SIZE,
																																javax.swing.GroupLayout.DEFAULT_SIZE,
																																Short.MAX_VALUE)
																														.addComponent(
																																jftTelefone,
																																javax.swing.GroupLayout.Alignment.LEADING)
																														.addComponent(
																																ctIdentidade,
																																javax.swing.GroupLayout.Alignment.LEADING,
																																javax.swing.GroupLayout.DEFAULT_SIZE,
																																javax.swing.GroupLayout.DEFAULT_SIZE,
																																Short.MAX_VALUE)
																														.addComponent(
																																jftCPF,
																																javax.swing.GroupLayout.Alignment.LEADING)
																														.addComponent(
																																jftCelular,
																																javax.swing.GroupLayout.Alignment.LEADING,
																																javax.swing.GroupLayout.DEFAULT_SIZE,
																																133,
																																Short.MAX_VALUE))
																										.addPreferredGap(
																												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
																										.addComponent(
																												rotulo12,
																												javax.swing.GroupLayout.PREFERRED_SIZE,
																												javax.swing.GroupLayout.DEFAULT_SIZE,
																												javax.swing.GroupLayout.PREFERRED_SIZE)
																										.addPreferredGap(
																												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																										.addComponent(
																												cgTipoCnh,
																												javax.swing.GroupLayout.PREFERRED_SIZE,
																												72,
																												javax.swing.GroupLayout.PREFERRED_SIZE))
																						.addGroup(
																								pnlCadastroClienteLayout
																										.createSequentialGroup()
																										.addGroup(
																												pnlCadastroClienteLayout
																														.createParallelGroup(
																																javax.swing.GroupLayout.Alignment.TRAILING,
																																false)
																														.addComponent(
																																ctContato2,
																																javax.swing.GroupLayout.Alignment.LEADING,
																																javax.swing.GroupLayout.DEFAULT_SIZE,
																																javax.swing.GroupLayout.DEFAULT_SIZE,
																																Short.MAX_VALUE)
																														.addComponent(
																																ctContato1,
																																javax.swing.GroupLayout.Alignment.LEADING,
																																javax.swing.GroupLayout.DEFAULT_SIZE,
																																425,
																																Short.MAX_VALUE))
																										.addPreferredGap(
																												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																										.addGroup(
																												pnlCadastroClienteLayout
																														.createParallelGroup(
																																javax.swing.GroupLayout.Alignment.LEADING)
																														.addGroup(
																																pnlCadastroClienteLayout
																																		.createSequentialGroup()
																																		.addComponent(
																																				rotulo24,
																																				javax.swing.GroupLayout.PREFERRED_SIZE,
																																				javax.swing.GroupLayout.DEFAULT_SIZE,
																																				javax.swing.GroupLayout.PREFERRED_SIZE)
																																		.addPreferredGap(
																																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																																		.addComponent(
																																				ctTelefone1,
																																				javax.swing.GroupLayout.DEFAULT_SIZE,
																																				145,
																																				Short.MAX_VALUE))
																														.addGroup(
																																pnlCadastroClienteLayout
																																		.createSequentialGroup()
																																		.addComponent(
																																				rotulo25,
																																				javax.swing.GroupLayout.PREFERRED_SIZE,
																																				javax.swing.GroupLayout.DEFAULT_SIZE,
																																				javax.swing.GroupLayout.PREFERRED_SIZE)
																																		.addPreferredGap(
																																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																																		.addComponent(
																																				ctTelefone2,
																																				javax.swing.GroupLayout.DEFAULT_SIZE,
																																				145,
																																				Short.MAX_VALUE))))))
														.addComponent(
																rotulo22,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo23,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addContainerGap()));
		pnlCadastroClienteLayout
				.setVerticalGroup(pnlCadastroClienteLayout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								pnlCadastroClienteLayout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												pnlCadastroClienteLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo1,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctNome,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												pnlCadastroClienteLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo2,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctIdentidade,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												pnlCadastroClienteLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo3,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																jftCPF,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addGroup(
												pnlCadastroClienteLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																ctCnh,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo11,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo12,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																cgTipoCnh,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addGroup(
												pnlCadastroClienteLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																jftTelefone,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo4,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addGap(14, 14, 14)
										.addGroup(
												pnlCadastroClienteLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																jftCelular,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo5,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												pnlCadastroClienteLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo22,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctContato1,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo24,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctTelefone1,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												pnlCadastroClienteLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo23,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctContato2,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo25,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctTelefone2,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addGap(26, 26, 26)));

		jtpCadastro.addTab("Cliente", pnlCadastroCliente);

		rotulo6.setText("Endereco:");

		rotulo7.setText("Numero:");

		rotulo8.setText("Bairro:");

		rotulo9.setText("Cidade:");

		rotulo10.setText("CEP:");

		ctEndereco.setMaxLength(100);

		ctNumero.setMaxLength(10);

		ctBairro.setMaxLength(100);

		ctCidade.setMaxLength(100);

		try
		{
			jftCep
					.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(
							new javax.swing.text.MaskFormatter("##.###-###")));
		} catch (java.text.ParseException ex)
		{
			ex.printStackTrace();
		}

		javax.swing.GroupLayout pnlCadastroEnderecoLayout = new javax.swing.GroupLayout(
				pnlCadastroEndereco);
		pnlCadastroEndereco.setLayout(pnlCadastroEnderecoLayout);
		pnlCadastroEnderecoLayout
				.setHorizontalGroup(pnlCadastroEnderecoLayout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								pnlCadastroEnderecoLayout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												pnlCadastroEnderecoLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addComponent(
																rotulo6,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo7,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo8,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo10,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo9,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addGroup(
												pnlCadastroEnderecoLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addComponent(
																ctNumero,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																96,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctEndereco,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																649,
																Short.MAX_VALUE)
														.addGroup(
																pnlCadastroEnderecoLayout
																		.createSequentialGroup()
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				pnlCadastroEnderecoLayout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.LEADING)
																						.addComponent(
																								ctCidade,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								649,
																								Short.MAX_VALUE)
																						.addComponent(
																								ctBairro,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								649,
																								Short.MAX_VALUE)
																						.addComponent(
																								jftCep,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								94,
																								javax.swing.GroupLayout.PREFERRED_SIZE))))
										.addContainerGap()));
		pnlCadastroEnderecoLayout
				.setVerticalGroup(pnlCadastroEnderecoLayout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								pnlCadastroEnderecoLayout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												pnlCadastroEnderecoLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo6,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctEndereco,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												pnlCadastroEnderecoLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo7,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctNumero,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												pnlCadastroEnderecoLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo8,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctBairro,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												pnlCadastroEnderecoLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																ctCidade,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo9,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addGroup(
												pnlCadastroEnderecoLayout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo10,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																jftCep,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addContainerGap(119, Short.MAX_VALUE)));

		jtpCadastro.addTab("Endere\u00e7o", pnlCadastroEndereco);

		rotulo13.setText("Nome:");

		rotulo14.setText("Fun\u00e7\u00e3o:");

		rotulo15.setText("Telefone 1:");

		rotulo16.setText("Telefone 2:");

		rotulo17.setText("Endere\u00e7o:");

		rotulo18.setText("Numero:");

		rotulo19.setText("Cidade:");

		ctNomeEmpresa.setMaxLength(100);

		ctFuncao.setMaxLength(100);

		try
		{
			ctTelefoneEmpresa1
					.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(
							new javax.swing.text.MaskFormatter("(##)####-####")));
		} catch (java.text.ParseException ex)
		{
			ex.printStackTrace();
		}

		try
		{
			ctTelefoneEmpresa2
					.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(
							new javax.swing.text.MaskFormatter("(##)####-####")));
		} catch (java.text.ParseException ex)
		{
			ex.printStackTrace();
		}

		ctEnderecoEmpresa.setMaxLength(100);

		ctNumeroEmpresa.setMaxLength(10);

		rotulo20.setText("Bairro:");

		ctBairroEmpresa.setMaxLength(100);

		ctCidadeEmpresa.setMaxLength(100);

		rotulo21.setText("CEP:");

		try
		{
			ctCepEmpresa
					.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(
							new javax.swing.text.MaskFormatter("##.###-###")));
		} catch (java.text.ParseException ex)
		{
			ex.printStackTrace();
		}

		javax.swing.GroupLayout painel1Layout = new javax.swing.GroupLayout(
				painel1);
		painel1.setLayout(painel1Layout);
		painel1Layout
				.setHorizontalGroup(painel1Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								painel1Layout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												painel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addComponent(
																rotulo13,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo14,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo15,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo17,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo18,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo19,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo21,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addGroup(
												painel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addComponent(
																ctNomeEmpresa,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																643,
																Short.MAX_VALUE)
														.addComponent(
																ctFuncao,
																javax.swing.GroupLayout.Alignment.TRAILING,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																643,
																Short.MAX_VALUE)
														.addComponent(
																ctEnderecoEmpresa,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																643,
																Short.MAX_VALUE)
														.addGroup(
																painel1Layout
																		.createSequentialGroup()
																		.addGroup(
																				painel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.TRAILING,
																								false)
																						.addComponent(
																								ctCepEmpresa,
																								javax.swing.GroupLayout.Alignment.LEADING,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								Short.MAX_VALUE)
																						.addComponent(
																								ctNumeroEmpresa,
																								javax.swing.GroupLayout.Alignment.LEADING,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								Short.MAX_VALUE)
																						.addComponent(
																								ctTelefoneEmpresa1,
																								javax.swing.GroupLayout.Alignment.LEADING,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								129,
																								Short.MAX_VALUE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				painel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.TRAILING)
																						.addComponent(
																								rotulo16,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								rotulo20,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				painel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.LEADING,
																								false)
																						.addGroup(
																								painel1Layout
																										.createSequentialGroup()
																										.addComponent(
																												ctTelefoneEmpresa2,
																												javax.swing.GroupLayout.PREFERRED_SIZE,
																												144,
																												javax.swing.GroupLayout.PREFERRED_SIZE)
																										.addGap(
																												287,
																												287,
																												287))
																						.addComponent(
																								ctBairroEmpresa,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								Short.MAX_VALUE)))
														.addComponent(
																ctCidadeEmpresa,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																643,
																Short.MAX_VALUE))
										.addContainerGap()));
		painel1Layout
				.setVerticalGroup(painel1Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								painel1Layout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												painel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo13,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctNomeEmpresa,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												painel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo14,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctFuncao,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												painel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo15,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo16,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctTelefoneEmpresa2,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctTelefoneEmpresa1,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												painel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo17,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctEnderecoEmpresa,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												painel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo18,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctNumeroEmpresa,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctBairroEmpresa,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																rotulo20,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												painel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo19,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctCidadeEmpresa,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												painel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(
																rotulo21,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(
																ctCepEmpresa,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addContainerGap(39, Short.MAX_VALUE)));

		jtpCadastro.addTab("Empresa", painel1);

		pnlPrincipal.add(jtpCadastro, java.awt.BorderLayout.CENTER);

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addComponent(
				pnlPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE,
				javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
		layout.setVerticalGroup(layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addComponent(
				pnlPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, 343,
				Short.MAX_VALUE));

		pack();
	}// </editor-fold>
	//GEN-END:initComponents

	private void jftCPFFocusLost(java.awt.event.FocusEvent evt)
	{
		String cpf = jftCPF.getText();
		if (!ValidadaCPF.validaCPF(cpf))
		{
			JOptionPane.showMessageDialog(this, "CPF "
					+ Menssagens.itemInvalido);
		}
	}

	//GEN-BEGIN:variables
	// Variables declaration - do not modify
	private telas.componentes.BarraOperacoesTela botBotoes;
	private telas.componentes.ComboGeral cgTipoCnh;
	private telas.componentes.CampoTexto ctBairro;
	private telas.componentes.CampoTexto ctBairroEmpresa;
	private telas.componentes.CampoTexto ctCepEmpresa;
	private telas.componentes.CampoTexto ctCidade;
	private telas.componentes.CampoTexto ctCidadeEmpresa;
	private telas.componentes.CampoTexto ctCnh;
	private telas.componentes.CampoTexto ctContato1;
	private telas.componentes.CampoTexto ctContato2;
	private telas.componentes.CampoTexto ctEndereco;
	private telas.componentes.CampoTexto ctEnderecoEmpresa;
	private telas.componentes.CampoTexto ctFuncao;
	private telas.componentes.CampoTexto ctIdentidade;
	private telas.componentes.CampoTexto ctNome;
	private telas.componentes.CampoTexto ctNomeEmpresa;
	private telas.componentes.CampoTexto ctNumero;
	private telas.componentes.CampoTexto ctNumeroEmpresa;
	private telas.componentes.CampoTexto ctTelefone1;
	private telas.componentes.CampoTexto ctTelefone2;
	private telas.componentes.CampoTexto ctTelefoneEmpresa1;
	private telas.componentes.CampoTexto ctTelefoneEmpresa2;
	private javax.swing.JFormattedTextField jftCPF;
	private javax.swing.JFormattedTextField jftCelular;
	private javax.swing.JFormattedTextField jftCep;
	private javax.swing.JFormattedTextField jftTelefone;
	private javax.swing.JTabbedPane jtpCadastro;
	private telas.componentes.Painel painel1;
	private telas.componentes.Painel pnlCadastroCliente;
	private telas.componentes.Painel pnlCadastroEndereco;
	private telas.componentes.Painel pnlPrincipal;
	private telas.componentes.Rotulo rotulo1;
	private telas.componentes.Rotulo rotulo10;
	private telas.componentes.Rotulo rotulo11;
	private telas.componentes.Rotulo rotulo12;
	private telas.componentes.Rotulo rotulo13;
	private telas.componentes.Rotulo rotulo14;
	private telas.componentes.Rotulo rotulo15;
	private telas.componentes.Rotulo rotulo16;
	private telas.componentes.Rotulo rotulo17;
	private telas.componentes.Rotulo rotulo18;
	private telas.componentes.Rotulo rotulo19;
	private telas.componentes.Rotulo rotulo2;
	private telas.componentes.Rotulo rotulo20;
	private telas.componentes.Rotulo rotulo21;
	private telas.componentes.Rotulo rotulo22;
	private telas.componentes.Rotulo rotulo23;
	private telas.componentes.Rotulo rotulo24;
	private telas.componentes.Rotulo rotulo25;
	private telas.componentes.Rotulo rotulo3;
	private telas.componentes.Rotulo rotulo4;
	private telas.componentes.Rotulo rotulo5;
	private telas.componentes.Rotulo rotulo6;
	private telas.componentes.Rotulo rotulo7;
	private telas.componentes.Rotulo rotulo8;
	private telas.componentes.Rotulo rotulo9;
	// End of variables declaration//GEN-END:variables

	private TipoCnh tipoCnh = new TipoCnh();

}